<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>简单的Store应用</title>
  <script src="vue.js"></script>
  <script src="vuex.js"></script>
</head>
<body>
<div id="app">
	<input type="button" value="单击增加1" @click="increment()" >
	 {{ this.$store.state.count }}
</div> 
<script>
  const store = new Vuex.Store({
      state:{
          count:1
      },
      mutations: {
          increment (state) {
            state.count++
         }
       }
    })
  var vm=new Vue({ 
      el:"#app",
      store:store, 		
      methods: {
        increment() {
          this.$store.commit('increment')
          console.log(this.$store.state.count)
        }
      }
  })
</script>
</body>
</html>